// 主机管理相关接口
import request from '@/utils/request'

/**
 * 机柜
 * @returns {*}
 */
export function listCabinet() {
  return request({
    url: '/bd-manager/api/cabinet',
    method: 'get'
  })
}

/**
 * 主机类型
 * @returns {*}
 */
export function listHostType() {
  return request({
    url: '/bd-manager/api/host/type',
    method: 'get'
  })
}

/**
 * 操作系统类型
 * @returns {*}
 */
export function listOsType() {
  return request({
    url: '/bd-manager/api/host/type/os',
    method: 'get'
  })
}

export function queryByPage(param) {
  return request({
    url: '/bd-manager/api/host',
    method: 'post',
    params: param
  })
}

export function listPhysical(param) {
  return request({
    url: '/bd-manager/api/host/physical',
    method: 'post',
    params: param
  })
}

export function saveHost(param) {
  return request({
    url: '/bd-manager/api/host/add',
    method: 'post',
    params: param
  })
}

export function updateHost(param) {
  return request({
    url: '/bd-manager/api/host/update',
    method: 'post',
    params: param
  })
}

export function deleteHost(host) {
  return request({
    url: '/bd-manager/api/host/delete/' + host,
    method: 'get'
  })
}
